function [ B, Br ] = getBain( )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here

doPlotting = 1;

variants = {...
    % V  plane_g     plane_a     dir_g       dir_a 
    { 1, [ 0  0  1], [ 0  0  1], [ 1  0  0], [ 1  1  0]},...
    { 2, [ 1  0  0], [ 0  0  1], [ 0  1  0], [ 1  1  0]},...
    { 3, [ 0  1  0], [ 0  0  1], [ 0  0  1], [ 1  1  0]},...
    };

B = cell(1,3);
Br = rotation();
for i = 1:3
    vdata = variants{i};
    % ??? problem with transformation direction
	B{i} = makeOR(vdata{3}',vdata{2}', vdata{5}',vdata{4}', 'a2g');
    Br(i) = rotation('matrix', B{i}');
end

[Br*vector3d(0,0,1); Br*vector3d(0,1,0); Br*vector3d(1,0,0)];

%% Plotting
if doPlotting
    %% Plotting options
    % Axis options
    from = '\gamma';
    cb = [0.5 0.5 0.5];

    % Markers type
    mt = {'o','^','s','p'};

    %% Plot CP group

    % Plot axis
    figure('Name', 'CP Group');
    plot([vector3d(1,0,0) vector3d(0,1,0) vector3d(0,0,1)],...
        'label', {['100' from],['010' from],['001' from]},...
        'antipodal','grid_res',15*degree, 'MarkerColor', cb);
    hold on;

    % Plot variants
    cs = symmetry('m-3m');
    p = [Br*vector3d(0,0,1); Br*vector3d(0,1,0); Br*vector3d(1,0,0)];;
    p = cs*p;
    % plot(p, 'antipodal', 'label', ['CP' num2str(i)], 'Marker',mt{i}); hold on;
    plot(p, 'antipodal', 'Marker',mt{i}); hold on;

    end
    legend('{100}_\gamma', 'B')
    hold off;
end